package com.leoman.postapi.service;

import com.leoman.category.entity.Category;
import com.leoman.exception.*;
import com.leoman.post.entity.PostBase;
import com.leoman.post.entity.vo.PostCommentVo;
import com.leoman.post.entity.vo.PostMiniVo;
import com.leoman.systemsetting.entity.HotWords;
import org.springframework.data.domain.Page;
import org.springframework.web.multipart.MultipartRequest;

import java.util.List;

/**
 * 帖子接口类
 * Created by 涂奕恒 on 2016/6/12.
 */
public interface PostService {

    // 普通用户发帖
    void saveUserPost(MultipartRequest multipartRequest, Long userId, Long category, String content, Integer voiceLength, Integer imgCount) throws ParamsErrorException, UserSpeakErrorException;

    // 发布直播帖
    void saveZbPost(MultipartRequest multipartRequest, Long userId, Long postId, String content, Integer voiceLength, Integer imgCount) throws ParamsErrorException, PostNotFindException, UserSpeakErrorException;

    // 用户删除帖子
    void deletePost(Long postId) throws PostNotFindException;

    // 发表关于帖子的评论
    void savePostComment(MultipartRequest multipartRequest, Integer type, Long postId, Long userId, String content) throws UserSpeakErrorException;

    // 获取帖子列表
    Page<PostBase> iPage(String key, Long targetUserId, Long category, Long userId, Integer pageNum, Integer pageSize) throws ParamsErrorException;

    // 根据id获取帖子详情
    PostBase findOneById(Long postId, Long userId) throws ParamsErrorException, PostNotFindException;

    // 获取帖子评论列表
    Page<PostCommentVo> commentPage(Integer type, Long postId, Long userId, Integer pageNum, Integer pageSize);

    // 回复帖子评论
    void savePostReply(MultipartRequest multipartRequest, Long postCommentId, Long userId, String content) throws ParamsErrorException, UserSpeakErrorException, CommentNotFindException;

    // 用户打赏主创
    void reward(Long creatorId, Long userId, Integer count, Long postId) throws ParamsErrorException, CreatorNotFindException, UserSpeakErrorException, BreadShortException, PostNotFindException;

    // 投票帖投票
    void vote(Long userId, String tpPostSubId) throws ParamsErrorException, UserSpeakErrorException, VoteExistException, LevelIsNotEnoughException;

    // 我回复的（赞过的）帖子列表
    Page<PostMiniVo> iPageByUserId(Long userId, Integer type, Integer pageNum, Integer pageSize) throws ParamsErrorException, UserNotFindException;

    // 帖子分类列表
    List<Category> postTypeList();

    // 我收藏的帖子列表（分页）
    Page<PostBase> iPageByUserCollect(Long userId, Integer pageNum, Integer pageSize);

    // 查询热词列表
    List<HotWords> iFindList();
}
